import { createRouter, createWebHashHistory } from 'vue-router'


const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Index',
      redirect: '/home',
      children: [
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/HomeView.vue'),
        },
      ]

    },
    {
      path: '/article/:articleId',
      name: 'article',
      props: true,
      component: () => import('@/views/ArticleView.vue'),
    },
    {
      path: '/article/:articleId/comments',
      name: 'comments',
      props: true,
      component: () => import('@/views/CommentsView.vue'),
    },

  ],
})

export default router
